﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage.Master" 
    CodeBehind="wfOrdenCompra.aspx.cs" Inherits="CO.wfOrdenCompra" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
     <link href="../Styles/General.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/token-input-facebook.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />

    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
   
    <script src="../Scripts/jquery.tokeninput.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.purr.js" type="text/javascript"></script>
    <script src="../Scripts/General.js" type="text/javascript"></script>
  
    <script src="js/global.js" type="text/javascript"></script>
     
     <script type="text/javascript">



         function fDevolverSeleccion(codigo) {
             document.getElementById("<%= dpProv.ClientID %>").value = codigo
         }

         function fDevolverSeleccion2(codigo, Descrip) {
             document.getElementById("<%= txtCodPago.ClientID %>").value = codigo
             document.getElementById("<%= lblCodPago.ClientID %>").value = Descrip
         }

         function fDevolverSeleccion3(codigo, Descrip) {
             document.getElementById("<%= HiddPedidoPor.ClientID %>").value = codigo
             document.getElementById("<%= lblPedidoPor.ClientID %>").value = Descrip
         }

         function fDevolverSeleccion4(codigo, Descrip) {
             document.getElementById("<%= dpImportacion.ClientID %>").value = codigo

         }


         function ResizeGrid() {
             internalGridResize("<%= GVDetalleProducto.ClientID %>");
         }


         function panelOnUpdating() {
             updatePanelAnimationUpdating();
         }


         function panelOnUpdated() {
             ResizeGrid();
             updatePanelAnimationUpdated();
         }

         function fDevolverSeleccion5(codigo, pres, producto, presenta, um, peso_bruto) {
             document.getElementById("<%= hddCodigo.ClientID %>").value = codigo
             document.getElementById("<%= hddPres.ClientID %>").value = pres
             document.getElementById("<%= hddProducto.ClientID %>").value = producto
             document.getElementById("<%= hddPresenta.ClientID %>").value = presenta
             document.getElementById("<%= hddUm.ClientID %>").value = um
             document.getElementById("<%= hddPesoBruto.ClientID %>").value = peso_bruto
         }


         function fLoadNumbers(combo1) {
             DoCallBack("RefreshLoadNumbers", combo1.value, End_fLoadNumbers)
         }
         //---------------------------------------------------------//
         function End_fLoadNumbers(arg) {
             var mData = arg.split(":::");
             document.getElementById("tdValorProv").innerHTML = mData[0];
             //si utilizas jQuery sería así
             //$("#tdValores").html(mData[0]);
         }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <input id="Button1" type="button" style="display: none" runat="server" />
       
    <input id="dummy" type="button" style="display: none" runat="server" />

   <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional">
      <ContentTemplate>
        <div class="ToolBar" style="height:24px;width:100%">
            <asp:ImageButton ID="btnGrabar" runat="server" style="width: 14px" ToolTip="Grabar" onclick="btnGrabar_Click"/>
            <asp:Label ID="Label19" runat="server" Font-Bold="True" ForeColor="Black" Text="Grabar"></asp:Label>        
            <asp:ImageButton ID="btnSalir" runat="server" onclick="btnSalir_Click"  style="width: 14px" ToolTip="Buscar" />
            <asp:Label ID="Label20" runat="server" Font-Bold="True" ForeColor="Black" Text="Salir"></asp:Label>
            <asp:ImageButton ID="btnImprimir" runat="server" onclick="btnImprimir_Click" PostBackUrl="~/Images/Icons/Enabled/Printer.png" style="width: 14px" ToolTip="Buscar" />
            <asp:Label ID="lblMensaje" runat="server" ForeColor="Red"></asp:Label>
        </div>
    </ContentTemplate>

</asp:UpdatePanel>
<table width="100%" cellpadding="0" cellspacing="2">
    <tr>
        <td style="width: 5px;">
            &nbsp;
        </td>
        <td>
            <table width="100%" cellpadding="0" cellspacing="2">
                <tr>
                    <td>
                        <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px;-webkit-border-radius: 5px; -ms-border-radius: 5px;">                        
                            <table width="100%" cellpadding="0" cellspacing="2">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label10" runat="server" Font-Size="Small" style="font-size: x-small" Text="Nro. O.C."></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblOC" runat="server" ForeColor="Blue"></asp:Label>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label1" runat="server" Font-Size="Small" style="font-size: x-small" Text="Fecha O/C"></asp:Label>
                                    </td>
                                    <td>
                                        <esd:esdDateTextBox ID="ucControlFecha1" runat="server" />
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label11" runat="server" style="font-size: x-small" Text="Cond. Pago"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCodPago" CssClass="esdTextBox" runat="server" Width="50px"></asp:TextBox>
                                        <asp:TextBox ID="lblCodPago"  CssClass="esdTextBox" runat="server"></asp:TextBox>
                                        <asp:ImageButton ID="btnBuscarCondPago" runat="server" onclick="btnBuscarCondPago_Click" style="width: 14px" />
                                    </td>
                                    <td>
                                       
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label2" runat="server" style="font-size: x-small" Text="Proveedor"></asp:Label>
                                    </td>
                                    <td id="tdValorProv">
                                        <asp:DropDownList ID="dpProv" runat="server" Width="200px" CssClass="esdTextBox"></asp:DropDownList>
                                        <asp:ImageButton ID="btnBuscarProv" runat="server" onclick="btnBuscarProv_Click" Height="14px" />
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td>
                                        &nbsp;
                                        <asp:Label ID="Label13" runat="server" Text="Tipo"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpTipo" CssClass="esdTextBox"  runat="server" Width="200px"></asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label3" runat="server" style="font-size: x-small" Text="Entrega en"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpEntregaPor" runat="server" Width="200px"  CssClass="esdTextBox" onselectedindexchanged="dpEntregaPor_SelectedIndexChanged"></asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                        <asp:Label ID="Label14" runat="server" style="font-size: x-small" Text="Modalidad"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpModalidad" CssClass="esdTextBox" runat="server" Width="200px"></asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label4" runat="server" style="font-size: x-small" Text="Pedido por"></asp:Label>
                                    </td>
                                    <td>
                                        <input id="HiddPedidoPor" runat="server" name="HiddPedidoPor" size="4" style="width: 56px; height: 0px" type="hidden" />
                                        <asp:TextBox ID="lblPedidoPor" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                        <asp:ImageButton ID="btnBuscarPedido" runat="server" Width="14px"  onclick="btnBuscarPedido_Click" />
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td>
                                        &nbsp;
                                        <asp:Label ID="Label15" runat="server" style="font-size: x-small" Text="Importacion"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpImportacion" runat="server" CssClass="esdTextBox" Width="200px"></asp:DropDownList>
                                        <asp:ImageButton ID="btnBuscarImport" runat="server" onclick="btnBuscarImport_Click" />
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label5" runat="server" style="font-size: x-small" Text="Usado en"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpUsadoEn" runat="server" Width="200px" CssClass="esdTextBox"  > 
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                        <asp:Label ID="Label16" runat="server" style="font-size: x-small" Text="Moneda"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpNoneda" CssClass="esdTextBox"  runat="server" Width="100px"></asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                    <td">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label6" runat="server" style="font-size: x-small" Text="Emitida por"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblEmitidoPor" CssClass="esdTextBox" runat="server"></asp:Label>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label17" runat="server" style="font-size: x-small" Text="Tipo de cambio"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTipCambio"  CssClass="esdTextBox" runat="server" Width="50px"></asp:TextBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label7" runat="server" style="font-size: x-small" Text="Prioridad"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="dpPrioridad" runat="server" Width="200px"  CssClass="esdTextBox"></asp:DropDownList>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Label ID="Label18" runat="server" style="font-size: x-small" Text="Fecha de entrega"></asp:Label>
                                    </td>
                                    <td>
                                        <esd:esdDateTextBox ID="ucControlFecha2" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <asp:Label ID="Label8" runat="server" style="font-size: x-small" Text="Observacion"></asp:Label>
                                    </td>
                                    <td class="style12" colspan="6">
                                        <asp:TextBox ID="txtObseracion"  CssClass="esdTextBox" runat="server" Height="50px" Width="294px"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                    <td align="right">
                        &nbsp;
                    </td>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="width: 5px;">
            &nbsp;
        </td>
        <td>
            <asp:HiddenField ID="hdnidCliProv" runat="server" />
            <asp:Button ID="btnNuevo" runat="server" onclick="btnNuevo_Click"  CssClass="esdButtonStyle" Text="Nuevo" />
            <input id="hidId" runat="server" name="hidId" size="1" style="width: 32px; height: 22px" type="hidden" />
            <input id="hdProducto" runat="server" name="hdColor" size="1" style="width: 32px; height: 22px" type="hidden" />

            <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                <div style="width: 1100px">
                    <div style="overflow: auto; width: 1100px; height: 201px">
                        <div class="DataDetail">
                            <asp:GridView ID="GVDetalleProducto" runat="server"  ScrollBars="Auto" ScrollWidth="100%" Width="100%" AutoGenerateColumns="False" 
                                ShowHeaderWhenEmpty="True" onrowcommand="GVDetalleProducto_RowCommand" onrowdatabound="GVDetalleProducto_RowDataBound" onrowdeleting="GVDetalleProducto_RowDeleting" > 
                            
                                <AlternatingRowStyle CssClass="esdGridAlternativeRowStyle" />
            
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="grdBttCmdEdit" CommandName="CmdEdit" CommandArgument="<%# Container.DataItemIndex %>"
                                                runat="server" ImageUrl="../Images/Icons/Enabled/Edit.png" 
                                                ToolTip="Filtrar Producto" />
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:TemplateField>

                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="grdBttCmdMost" CommandName="CmdMst" CommandArgument="<%# Container.DataItemIndex %>"
                                                runat="server" ImageUrl="../Images/Icons/Enabled/HISTAPRO.png" 
                                                ToolTip="Mostrar el Registro" />
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:TemplateField>

                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkBxSelect" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="N°">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtNumCorrelativo"  CssClass="esdTextBox"  runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem._Nu_Correla") %>'
                                                Width="50px"></asp:TextBox>
                                        </ItemTemplate>
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                        <ItemStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="idProducto" Visible="False">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtIdproducto" runat="server"  CssClass="esdTextBox"  
                                                Width="100px"  Text='<%# DataBinder.Eval(Container, "DataItem._Codigo") %>' 
                                                Enabled="False"></asp:TextBox>
                                        </ItemTemplate>
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                        <ItemStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Id pres" Visible="False">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtIdPres" runat="server" CssClass="esdTextBox"  Width="50px"  
                                                Text='<%# DataBinder.Eval(Container, "DataItem._Pres") %>' Enabled="False"></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                           
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Producto">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtDsProducto" runat="server" CssClass="esdTextBox"  
                                                Width="200px"  Text='<%# DataBinder.Eval(Container, "DataItem._Producto") %>' 
                                                Enabled="False"></asp:TextBox>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Presentacion">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtPresentacion" runat="server" CssClass="esdTextBox"  
                                                Width="50px"  Text='<%# DataBinder.Eval(Container, "DataItem._Presenta") %>' 
                                                Enabled="False"></asp:TextBox>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Descripcion">
                                            <ItemTemplate>
                                            <asp:TextBox ID="txtDescrip" runat="server" CssClass="esdTextBox"  
                                                Width="50px"  Text='<%# DataBinder.Eval(Container, "DataItem._detalle") %>'  ></asp:TextBox>
                                  
                                        </ItemTemplate>

                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="U.M">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtUM" runat="server" CssClass="esdTextBox"  Width="50px"  
                                                Text='<%# DataBinder.Eval(Container, "DataItem._UM") %>' Enabled="False"></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Peso Bruto" Visible="False">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtPesoBruto" runat="server" CssClass="esdTextBox"  
                                                Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Peso_Bruto") %>' 
                                                Enabled="False"></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Lote">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtLote" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Lote") %>'></asp:TextBox>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Fec. Vencimiento" Visible="False">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtFecVencimiento" runat="server" CssClass="esdTextBox" 
                                                Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem._fe_venc") %>'></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Fec.Entrega" Visible="False">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtFecEngrega" runat="server" CssClass="esdTextBox" 
                                                Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem._fe_Entrega") %>'></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="O.P">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="dpdOP" runat="server" Width="100px" >
                                                <asp:ListItem Value="P000002">Bocanegra</asp:ListItem>
                                                <asp:ListItem Value="P000003">Faucett</asp:ListItem>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Cantidad">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtCantidad" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Cant") %>'></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="p.Neto">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtPneto" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._PreNeto") %>'></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="P.U">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtPU" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._PreUnit") %>'></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="%Desc">
                             
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtPorDesc"  CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._nu_pordscto") %>'></asp:TextBox>
                                            </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Afect.IGV">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkBxIGV" runat="server"  />
                                                </ItemTemplate>
                                                    <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="T.G">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="dpTG" runat="server" Width="150px" AutoPostBack="True" 
                                                onselectedindexchanged="dpTG_SelectedIndexChanged">
                                            </asp:DropDownList>

                                        </ItemTemplate>
                                            <HeaderStyle Font-Size="X-Small" />
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Und.Negocio">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="dpdUN" runat="server" Width="150px" AutoPostBack="True" 
                                                onselectedindexchanged="dpdUN_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />

                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="idUN" >
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtidUn" CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._id_Gasto") %>' ></asp:TextBox>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Unid.Negocio" Visible="true">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtdsUn" CssClass="esdTextBox"  runat="server" Width="150px" Text='<%# DataBinder.Eval(Container, "DataItem._C_Gasto") %>'></asp:TextBox>
                                        </ItemTemplate>
                                    <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="C.C">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="dpdCC" runat="server" Width="150px"  AutoPostBack="True" 
                                                onselectedindexchanged="dpdCC_SelectedIndexChanged"  >
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="idCosto">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtIdccostos" CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._idCosto") %>' ></asp:TextBox>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="dsCosto" Visible="False">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtdsCosto" CssClass="esdTextBox"  runat="server" Width="150px" Text='<%# DataBinder.Eval(Container, "DataItem._C_Costos") %>'></asp:TextBox>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Gto.Import">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="dpdGtoImport" runat="server" Width="150px">
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>

                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="grdBttCmdCalcular" CommandName="CmdCalc" CommandArgument="<%# Container.DataItemIndex %>"
                                                runat="server" ImageUrl="../Images/Icons/Enabled/Calculator.png" 
                                                ToolTip="Actualizar Totales"/>
                                        </ItemTemplate>
                                        <HeaderStyle Width="22px" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Dscto">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtDscto" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Dscto") %>'></asp:TextBox>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="IGV">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtIGV" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Igv") %>'></asp:TextBox>
                                        </ItemTemplate>
                                            <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField HeaderText="Sub. Total">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtSubTotal" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._subTotal") %>'></asp:TextBox>
                                        </ItemTemplate>
                                        <ControlStyle Font-Size="X-Small" />
                                        <FooterStyle Font-Size="X-Small" />
                                        <HeaderStyle Font-Size="X-Small" />
                                    </asp:TemplateField>
                        
                                    <asp:TemplateField>
                                            <ItemStyle HorizontalAlign="Center" Width="40px" CssClass="etiqueta"></ItemStyle>
                                            <ItemTemplate>
                                            <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/Icons/Enabled/bt_borrar.gif"
                                                CommandName="CmdDel" 
                                                CommandArgument='<%# Container.DataItemIndex%>'>
                                            </asp:ImageButton>
                                        </ItemTemplate>
                                        </asp:TemplateField>

                                </Columns>

                                <HeaderStyle CssClass="esdGridHeaderStyle" />
                                <PagerStyle CssClass="gridPagerStyle" />
                                <RowStyle CssClass="esdGridRowStyle" />
                                <SelectedRowStyle CssClass="esdGridSelectedRowStyle" />
                                <EmptyDataTemplate>
                                    <div id="gridempty">
                                        <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />&nbsp;No existen registros para esta solicitud.
                                    </div>
                                </EmptyDataTemplate>
                            </asp:GridView>
                        </div>
                    </div>
                        <div>
                            <div align="right">
                                <div>
                                    <asp:Label ID="Label9" runat="server"  Text="Sub Total:"></asp:Label>
                                    <asp:TextBox ID="txtSTotal" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                </div>
                                <div>
                                    <asp:Label ID="lblDsc" runat="server"  Text="Tot.Desc:"></asp:Label>
                                    <asp:TextBox ID="txtDescuento" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                </div>
                                <div>
                                    <asp:Label ID="lblIgv" runat="server" Text="Tot.IGV :"></asp:Label>
                                    <asp:TextBox ID="txtIgv_" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                </div>
                                <div>
                                    <asp:Label ID="lblTotal" runat="server" Text="Total    :"></asp:Label>                      
                                    <asp:TextBox ID="txtTotal_" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                </div>
                            </div>
                        </div>
                </div>
            </div>
        </td>
    </tr>
</table>
        <input id="HddIdEmitidopor" type="hidden" runat ="server"/>
        <input id="hddIdOC" type="hidden" runat ="server" />
        <input id="hddCodigo" type="hidden" runat ="server" />
        <input id="hddPres" type="hidden" runat ="server"/>
        <input id="hddProducto" type="hidden" runat ="server"/>
        <input id="hddPresenta" type="hidden" runat ="server"/>

        <input id="hddUm" type="hidden" runat ="server"/>
        <input id="hddPesoBruto" type="hidden" runat ="server"/>

         <input id="hidVentana" runat="server" name="hidVentana" size="1" style="width: 32px; height: 22px" type="hidden" />
         
  
      <asp:HiddenField ID="HiddenField1" runat="server" />

</asp:Content>
